//
//  WY3SDK.m
//  WaWaYaYaLogin
//
//  Created by telen on 15/9/9.
//  Copyright (c) 2015年 刘赞黄Telen. All rights reserved.
//

#import "NSObject+Telen.h"
#import "WY_KeychainUtils.h"

@interface UIImageView (WY3SDK);

- (BOOL)setWY3SDK_avatarWithPalaceHolder:(UIImage *)palceHolder;

@end

@implementation UIImageView (WY3SDK)

- (BOOL)setWY3SDK_avatarWithPalaceHolder:(UIImage *)palceHolder {
    return NO;
//    WYUser *user = [WYSDKManager shareManager].user;
//    UIImage *pHolder = nil;
//    
//    if ([user.gender integerValue] == 1) { //female
//        if (user.role == WYRole_Kid) {
//            pHolder = [ResCode imageOfAvatar_girl];
//        }else {
//            pHolder = [ResCode imageOfAvatar_woman];
//        }
//    }else {
//        if (user.role == WYRole_Kid) {
//            pHolder = [ResCode imageOfAvatar_boy];
//        }else {
//            pHolder = [ResCode imageOfAvatar_man];
//        }
//    }
//    if (palceHolder) {
//        pHolder = palceHolder;
//    }
//    if (user.avatar && user.avatar.length > 0) {
//        
//        [self setImageWithURL:[NSURL URLWithString:user.avatar] placeholderImage:pHolder];
//        return YES;
//    }else {
//        self.image = pHolder;
//        return NO;
//    }
}

@end


#import "WY3SDKLogin.h"

@implementation WY3SDKLogin

+ (void)setAppId:(NSString *)appId andSecretKey:(NSString *)appsecretkey rootVC:(UIViewController *)rootVC
{
//    [WYSDKManager shareManager].appId = appId;
//    [WYSDKManager shareManager].appSecretKey = appsecretkey;
//    [WYSDKManager shareManager].rootvc = rootVC;
}

+ (void)setWY3SDKAppType:(WY3SDK_AppType)type {
    //[WYSDKManager shareManager].appType = type;
}

#define __IDFVServer  @"com.wawayaya.reader.uuid"
+ (NSString*)get_idfv
{
    return [WY3SDKLogin getIDFV];
}


+(NSString *)getIDFV
{
    NSString * udidInKeyChain = [WY_SFHFKeychainUtils getPasswordForUsername:@"UMSAgentUDID" andServiceName:@"UMSAgent" error:nil];
    if (!udidInKeyChain) {
        udidInKeyChain = [WY3SDKLogin load:__IDFVServer];
    }
    if(udidInKeyChain && ![udidInKeyChain isEqualToString:@""])
    {
        if (![udidInKeyChain hasPrefix:@"idfv_"]) {
            udidInKeyChain = [NSString stringWithFormat:@"idfv_%@",udidInKeyChain];
        }
        return udidInKeyChain;
    }
    else
    {
        NSString *idfa = [[[UIDevice currentDevice] identifierForVendor] UUIDString];//idfv
        //NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
        if (idfa) {
            idfa = [NSString stringWithFormat:@"idfv_%@",idfa];
        }
        if(idfa && ![idfa isEqualToString:@""])
        {
            [WY_SFHFKeychainUtils storeUsername:@"UMSAgentUDID" andPassword:idfa forServiceName:@"UMSAgent" updateExisting:NO error:nil];
            [WY3SDKLogin save:__IDFVServer data:idfa];
            return idfa;
        }
        else
        {
            NSString *openUDID = @"idfv_0000-0000-0000-0000";
            return openUDID;
        }
    }
}

+ (NSMutableDictionary *)getKeychainQuery:(NSString *)service {
    return [NSMutableDictionary dictionaryWithObjectsAndKeys:
            (id)kSecClassGenericPassword,(id)kSecClass,
            service, (id)kSecAttrService,
            service, (id)kSecAttrAccount,
            (id)kSecAttrAccessibleAfterFirstUnlock,(id)kSecAttrAccessible,
            nil];
}

+ (void)save:(NSString *)service data:(id)data {
    //Get search dictionary
    NSMutableDictionary *keychainQuery = [self getKeychainQuery:service];
    //Delete old item before add new item
    SecItemDelete((CFDictionaryRef)keychainQuery);
    //Add new object to search dictionary(Attention:the data format)
    [keychainQuery setObject:[NSKeyedArchiver archivedDataWithRootObject:data] forKey:(id)kSecValueData];
    //Add item to keychain with the search dictionary
    SecItemAdd((CFDictionaryRef)keychainQuery, NULL);
}

+ (id)load:(NSString *)service {
    id ret = nil;
    NSMutableDictionary *keychainQuery = [WY3SDKLogin getKeychainQuery:service];
    //Configure the search setting
    //Since in our simple case we are expecting only a single attribute to be returned (the password) we can set the attribute kSecReturnData to kCFBooleanTrue
    [keychainQuery setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnData];
    [keychainQuery setObject:(id)kSecMatchLimitOne forKey:(id)kSecMatchLimit];
    CFDataRef keyData = NULL;
    if (SecItemCopyMatching((CFDictionaryRef)keychainQuery, (CFTypeRef *)&keyData) == noErr) {
        @try {
            ret = [NSKeyedUnarchiver unarchiveObjectWithData:(__bridge NSData *)keyData];
        } @catch (NSException *e) {
            NSLog(@"Unarchive of %@ failed: %@", service, e);
        } @finally {
        }
    }
    if (keyData)
        CFRelease(keyData);
    return ret;
}

+ (void)setDefultRoletype:(WY3SDK_DefualtRoleType)defultRoleType {
    //[WYSDKManager shareManager].defaultRoleType = @(defultRoleType);
}

+ (void)setURLDebug:(WY3SDK_UrlType)type
{
//    
//    [WYSDKManager shareManager].urlNetType = type;
//    [[WYSDKManager shareManager] loadUser];
    
}

+ (UIInterfaceOrientationMask)rotation
{
    return UIInterfaceOrientationMaskPortrait;
    //return [WYSDKManager shareManager].rotation;
}

+ (UIInterfaceOrientationMask)rotationTo
{
    return UIInterfaceOrientationMaskPortrait;
    //return [WYSDKManager shareManager].rotationTo;
}

+ (void)setRotationTo:(UIInterfaceOrientationMask)rotation
{
    //[[WYSDKManager shareManager] setRotationTo:rotation];
}

+ (UIInterfaceOrientationMask)rotationBack
{
     return UIInterfaceOrientationMaskPortrait;
    //return [WYSDKManager shareManager].rotationBack;
}

+ (void)setRotationBack:(UIInterfaceOrientationMask)rotation
{
    
    //[[WYSDKManager shareManager] setRotationBack:rotation];
}

+ (void)setDebugLabel:(BOOL)yn {
    //[WYSDKManager shareManager].debugLabel = yn;
}

+ (void)setStatusBarHidden:(BOOL)yn {
    //[WYSDKManager shareManager].isStatusHidden = yn;
}

+ (void)setDebugLog:(BOOL)yn
{
    //[WYSDKManager shareManager].debugLog = yn;
}

+ (void)reSetDebugText:(NSString *)str
{
    //[WYSDKManager shareManager].difineDebugInfo = str;
}


+ (void)dismissSDKVC {
    
//    if ([WYSDKManager shareManager].myNav) {
//        
//        [WYSDKManager shareManager].rotation = [WYSDKManager shareManager].rotationBack;
//        [[WYSDKManager shareManager].myNav dismissViewControllerAnimated:YES completion:^{
//            [WYSDKManager shareManager].myNav = nil;
//        }];
//    }
}

+ (BOOL)isWY3WaittingShowing {
    return NO;
    //return [WYSDKManager shareManager].isWY3WaittingShowing;
}

+ (NSString *)sdk_version
{
    return @"";
    //return WY3SDK_version;
}

+ (NSString *)getWY3Avatar {
     return @"";
//    WYUser *user = [WYSDKManager shareManager].user;
//    return user.avatar;
}

+ (BOOL)setWY3SDKAvatarForImageView:(UIImageView *)imgView palaceHolder:(UIImage *)palaceHolder{
    
//    if (imgView) {
//       return [imgView setWY3SDK_avatarWithPalaceHolder:palaceHolder];
//    }else {
      return NO;
//    }
}

+ (BOOL)isLogIn
{
//    if ([WYSDKManager shareManager].user.exist) {
//        return YES;
//    }
    return NO;
}

+ (BOOL)isWY3SDK_ViewController:(UIViewController *)vc
{
    return NO;
    //return [vc isKindOfClass:[WYIHBaseViewController class]] || [vc isKindOfClass:[WY3NaviController class]];
}

//TODO: login

// 当一账通登录成功后 等待JR登录 JR登录成功返回给我 YES/NO 判断是否saveUser和是否离开LoginVC



+ (void)changePassWordCommplete:(void (^)(BOOL))complete currentVC:(UIViewController*)currentVC;
{
//    WYSDKManager* wymgr = [WYSDKManager shareManager];
//    
//    if (!wymgr.user || wymgr.user.uid <=0 || wymgr.user.token ==nil || wymgr.user.token.length <= 0) {
//        complete(NO);
//        NSLog(@"SDK 未登录");
//    }else
//    {
//        if (!wymgr.myNav) {
//            WYChangePWDViewController* vc = [[WYChangePWDViewController alloc] initWithNibName:@"WYChangePWDViewController" bundle:nil];
//            vc.isRootVC = YES;
//            vc.complete = complete;
//            WY3NaviController* nav = [[WY3NaviController alloc] initWithRootViewController:vc];
//            nav.navigationBar.hidden = YES;
//            wymgr.myNav = nav;
//            if (currentVC) {
//                [currentVC presentViewController:nav animated:YES completion:nil];
//            }else{
//                [wymgr.rootvc presentViewController:nav animated:YES completion:nil];
//            }
//        }else{
//            complete(NO);
//        }
//    }
}

+ (void)logOut
{
//    [WYSDKManager shareManager].user = nil;
//    [[WYSDKManager shareManager] saveUser];
}


+ (void)showMessage:(NSString *)mesg WithVc:(UIViewController *)currentVC {
   // [[WY_WaitingShow shareSingleShow] showString:NSLocalizedStringFromTable(mesg, @"WYAccountSDK", @"") inSuperView:currentVC.view withIntervalTime:3.0];
}

+ (void)myQrCodeWithCurrentVC:(UIViewController*)currentVC {
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    
//    if (!sdkmgr.myNav) {
//        WYMyInfoViewController *myinfoVC = [[WYMyInfoViewController alloc] init];
//        
//        myinfoVC.isRootVC = YES;
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:myinfoVC];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        if (currentVC) {
//            [currentVC presentViewController:navi animated:YES completion:nil];
//        }else {
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }
}

+ (void)parentBindChildCommplete:(void(^)(BOOL bindSuccess))complete currentVC:(UIViewController*)currentVC;{
    
//    NSLog(@"enter");
//    //[WY3SDKLogin setRotationBack:UIInterfaceOrientationPortrait |UIInterfaceOrientationPortraitUpsideDown];
//    
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (cUser.role != 1) {
//        NSLog(@"当前角色不是家长");
//        return;
//    }
//    
//    if (!sdkmgr.myNav) {
//        WYParentAndChildBindingViewController *bindVC = [[WYParentAndChildBindingViewController alloc] init];
//        bindVC.bindingType = WYParentBindChind;
//        bindVC.isRootVC = YES;
//        
//        bindVC.complete = complete;
//        
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:bindVC];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        
//        if (currentVC) {
//            [currentVC presentViewController:navi animated:YES completion:nil];
//        }else{
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }else{
//        complete(NO);
//    }
//    
//

}

//家长解绑孩子
+ (void)ParentUBindChildWithKuid:(long long)kuid Ktoken:(NSString *)ktoken Commplete:(void(^)(BOOL ubindSuccess))complete currentVC:(UIViewController *)currentVC {
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    if (!sdkmgr.user.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (sdkmgr.user.role != WYRole_Parent) {
//        NSLog(@"!当前角色不是家长");
//        return;
//    }
//    
//    if (!kuid || !ktoken || [ktoken isEqualToString:@""]) {
//        NSLog(@"kuid或ktoken为空");
//        return;
//    }
//    
//    if (!sdkmgr.myNav) {
//        WYPerfectInfoViewController *perinfoVc = [[WYPerfectInfoViewController alloc] init];
//        perinfoVc.isRootVC = YES;
//        perinfoVc.isParentModifyKid = YES;
//        perinfoVc.kuid = kuid;
//        perinfoVc.ktoken = ktoken;
//        perinfoVc.complete = complete;
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:perinfoVc];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        if (currentVC) {
//            [currentVC presentViewController:navi animated:YES completion:nil];
//        }else {
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }
//    
}


+ (void)childBindParentCommplete:(void(^)(BOOL bindSuccess))complete currentVC:(UIViewController *)currentVC {
//    
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (cUser.role != 2) {
//        NSLog(@"当前角色不是孩子");
//        return;
//    }
//    if (currentVC) {
//        if ([[UIDevice currentDevice].systemVersion floatValue] < 8) {
//            [[WY_WaitingShow shareSingleShow] setDefaultWindow:currentVC.view];
//        }
//    }
//    NSNumber *uid = @(sdkmgr.user.uid);
//    NSString *token = sdkmgr.user.token;
//    WYBaseViewController *bsVC = [[WYBaseViewController alloc] init];
//    NSString *port = [NSString stringWithFormat:@"/ui/%@",uid];
//    [bsVC getNetRequestPort:port ref:@{@"uid":uid,@"token":token} success:^(NSDictionary *retDict) {
//        NSDictionary *dic = retDict[__NetDict];
//        NSDictionary *retmap = dic[@"retMap"];
//        if (retmap) {
//            NSDictionary *parentDic = retmap[@"parent"];
//            if (parentDic) {
//                [sdkmgr.user updateParentinfo:parentDic];
//            }else {
//                sdkmgr.user.parentId = 0;
//                sdkmgr.user.parentNickname = nil;
//            }
//            [sdkmgr saveUser];
//            
//            if (cUser.parentId > 0 ) { //MARK 已经绑定家长
//                if (!sdkmgr.myNav) {
//                    WYUnBindViewController *unbind = [[WYUnBindViewController alloc] init];
//                    unbind.showType = WY_UnBindType;
//                    unbind.isRootVC = YES;
//                    unbind.complete = complete;
//                    WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:unbind];
//                    navi.navigationBarHidden = YES;
//                    sdkmgr.myNav = navi;
//                    
//                    if (currentVC) {
//                        [currentVC presentViewController:navi animated:YES completion:nil];
//                    }else {
//                        [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//                    }
//                }
//            }else {                 //  还没绑定家长
//                if (!sdkmgr.myNav) {
//                    WYParentAndChildBindingViewController *bindVC = [[WYParentAndChildBindingViewController alloc] init];
//                    bindVC.bindingType = WYChildBindParent;
//                    bindVC.isRootVC = YES;
//                    
//                    bindVC.complete = complete;
//                    
//                    WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:bindVC];
//                    navi.navigationBarHidden = YES;
//                    sdkmgr.myNav = navi;
//                    
//                    if (currentVC) {
//                        [currentVC presentViewController:navi animated:YES completion:nil];
//                    }else{
//                        [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//                    }
//                }else{
//                    complete(NO);
//                }
//            }
//        }
//        
//    } fial:^(NSDictionary *retDict) {
//        
//    }];
}


+ (void)childJoinClassWithWithCommplete:(void(^)(BOOL ubindSuccess))complete currentVC:(UIViewController*)currentVC; {
//    
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (cUser.role != 2) {
//        NSLog(@"当前角色不是孩子");
//        return;
//    }
//    
//    if (!cUser.classId) {   //MARK:未加入班级
//        
//        if (!sdkmgr.myNav) {
//            WYTeacherInfoViewController *joinClassVc = [[WYTeacherInfoViewController alloc] init];
//            joinClassVc.vertiType = WY_Vertifi_ChildJoninClass;
//            joinClassVc.isRootVC = YES;
//            joinClassVc.complete = complete;
//            WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:joinClassVc];
//            navi.navigationBarHidden = YES;
//            sdkmgr.myNav = navi;
//            if (currentVC) {
//               [currentVC presentViewController:navi animated:YES completion:nil];
//            }else {
//                [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//            }
//        }else {
//            complete(NO);
//        }
//        
//    }else { //  MARK: 已经加入班级
//        
//        
//        if (!sdkmgr.myNav) {
//            WYUnBindViewController *classinfo = [[WYUnBindViewController alloc] init];
//            classinfo.showType = WY_ClassInfoType;
//            classinfo.isRootVC = YES;
//            WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:classinfo];
//            navi.navigationBarHidden = YES;
//            sdkmgr.myNav = navi;
//            if (currentVC) {
//                [currentVC presentViewController:navi animated:YES completion:nil];
//            }else {
//                [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//            }
//        }
//    }
}


+ (void)teahcerWorkFlowWithCurrentVC:(UIViewController *)currentVC didChangeStatus:(void(^)(BOOL ischangeStatus))isChangeStatus {
   
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (cUser.role != 3) {
//        NSLog(@"当前角色不是教师");
//        return;
//    }
//    WYTeacherJoinClassViewController *joinclass = [[WYTeacherJoinClassViewController alloc] init];
//    joinclass.isChangeStatus = isChangeStatus;
//    joinclass.isRootVC = YES;
//    if (!sdkmgr.myNav) {
//        
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:joinclass];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        if (currentVC) {
//           [currentVC presentViewController:navi animated:YES completion:nil];
//        }else {
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }
//    else {
//        
//        
//        [sdkmgr.myNav pushViewController:joinclass animated:YES];
//    }
}


+ (void)teacherCheckClassInfoWithClassId:(long)classId currentVc:(UIViewController *)currentVC didChangeStatus:(void(^)(BOOL ischangeStatus))isChangeStatus {
    
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    
//    if (!sdkmgr.user.exist) {
//        NSLog(@"sdk未登录");
//        return;
//    }
//    if (sdkmgr.user.role != WyRole_Teacher) {
//        NSLog(@"当前角色不是教师");
//        return;
//    }
//    if (!classId) {
//        NSLog(@"classId为空");
//        return;
//    }
//    
//    if (!sdkmgr.myNav) {
//        WYClassInfoViewController *classinfoVc = [[WYClassInfoViewController alloc] init];
//        classinfoVc.isRootVC = YES;
//        classinfoVc.classID = @(classId);
//     //   classinfoVc.complete = isChangeStatus;
//        //是否是班主任
//        classinfoVc.isChangeStatus = isChangeStatus;
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:classinfoVc];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        if (currentVC) {
//            [currentVC presentViewController:navi animated:YES completion:nil];
//        }else {
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }
}

+ (void)checkGroupInfoWithGroupNo:(long)groupNo groupName:(NSString *)groupName gouopCount:(NSInteger)count currentVc:(UIViewController *)currentVC didChangeStatus:(void(^)(BOOL ischangeStatus))isChangeStatus; {
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    
//    if (!sdkmgr.user.exist) {
//        NSLog(@"sdk未登录");
//        return;
//    }
//    if (sdkmgr.user.role != WyRole_Teacher) {
//        NSLog(@"当前角色不是教师");
//        return;
//    }
//    if (!groupNo) {
//        NSLog(@"groupNo为空");
//        return;
//    }
//    
//    if (!sdkmgr.myNav) {
//        WYGroupListViewController *groupList = [[WYGroupListViewController alloc] init];
//        NSMutableDictionary *mgroupDict = [NSMutableDictionary dictionary];
//        [mgroupDict setValue:@(groupNo).description forKey:@"groupNo"];
//        [mgroupDict setValue:groupName forKey:@"groupName"];
//        [mgroupDict setValue:@(count) forKey:@"groupUserCount"];
//        groupList.isRootVC = YES;
//        groupList.groupDict = mgroupDict;
//        //   classinfoVc.complete = isChangeStatus;
//        //是否是班主任
//        groupList.isChangeStatus = isChangeStatus;
//        WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:groupList];
//        navi.navigationBarHidden = YES;
//        sdkmgr.myNav = navi;
//        if (currentVC) {
//            [currentVC presentViewController:navi animated:YES completion:nil];
//        }else {
//            [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//        }
//    }
}


+ (void)childJoinfGroupComplete:(void(^)())complete currentVC:(UIViewController*)currentVC {
//    WYSDKManager *sdkmgr = [WYSDKManager shareManager];
//    WYUser *cUser = sdkmgr.user;
//    if (!cUser.exist) {
//        NSLog(@"SDK未登录");
//        return;
//    }
//    if (cUser.role != 2) {
//        NSLog(@"当前角色不是孩子");
//        return;
//    }
//    if (currentVC) {
//        if ([[UIDevice currentDevice].systemVersion floatValue] < 8) {
//            [[WY_WaitingShow shareSingleShow] setDefaultWindow:currentVC.view];
//        }
//    }
//    if (!sdkmgr.myNav) {
//        if (cUser.groupNum) {
//            WYGroupInfoViewController *groupVC = [[WYGroupInfoViewController alloc] init];
//            groupVC.isRootVC = YES;
//            groupVC.complete = complete;
//            WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:groupVC];
//            navi.navigationBarHidden = YES;
//            sdkmgr.myNav = navi;
//            if (currentVC) {
//                [currentVC presentViewController:navi animated:YES completion:nil];
//            }else {
//                [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//            }
//        }else {
//            WYJoinGroupViewController *joinVC = [[WYJoinGroupViewController alloc] init];
//            joinVC.isRootVC = YES;
//            joinVC.complete = complete;
//            WY3NaviController *navi = [[WY3NaviController alloc] initWithRootViewController:joinVC];
//            navi.navigationBarHidden = YES;
//            sdkmgr.myNav = navi;
//            if (currentVC) {
//                [currentVC presentViewController:navi animated:YES completion:nil];
//            }else {
//                [sdkmgr.rootvc presentViewController:navi animated:YES completion:nil];
//            }
//        }
//    }
}

//获取设备信息
+(void)deviceInfoCollectOnVC:(UIViewController*)onVC Exist:(void (^)(BOOL isExist))exist Completed:(void (^)(BOOL isFinish))completed{
//    [WYFirstChooseManager firstChooseUserInfoOnVC:onVC Exist:^(BOOL isExist) {
//        if (exist) exist(isExist);
//    } Completed:^(BOOL isFinish) {
//        if (completed) completed(isFinish);
//    }];
}

//清除设备信息
+(void)deleteDeviceInfo{
   // [WYFirstChooseManager deleteDeviceInfo];
}

//获取是否属于设备信息获取类
+(BOOL)isCollectDeviceInfoVC:(UIViewController*)vc{
    BOOL isDeviceInfoVC = NO;
//    if ([vc isKindOfClass:[WYChooseDeviceInfoBaseViewController class]]) {
//        isDeviceInfoVC = YES;
//    }
    return isDeviceInfoVC;
}

@end
